package org.speed.dubbo.spi.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.dubbo.common.URL;
import org.speed.dubbo.spi.request.Request;
import org.speed.dubbo.spi.service.RpcService;

public class OrderRpcService implements RpcService {
	
	private Request transport;

	public void setTransport(Request transport) {
		this.transport = transport;
	}

	@Override
	public void run(String framework) {
		System.out.println("OrderRpcService#run");
		URL url = buildUrl(framework);
		transport.sendRequest(url);
	}
	
	private URL buildUrl(String framework) {
		Map<String, String> map = new HashMap<String, String>() ;
		map.put("framework", framework);
		URL url = new URL("zookeeper","127.0.0.1",1212,map );
		return url;
	}

}
